package bean;

import java.sql.Connection;
import java.sql.DriverManager;

public class MyOracle {
	Connection conn;//반환을 받아야 한다.(중요)
	public MyOracle(){
		String driver = "oracle.jdbc.driver.OracleDriver";
		String url = "jdbc:oracle:thin:@127.0.0.1:1521:xe";
		String id = "hr";
		String pwd = "hr";
		
		try{
			Class.forName(driver);
			System.out.println("드라이버가 로딩됨.");
			
			conn = DriverManager.getConnection(url,id,pwd);
			System.out.println("connection 생성..");
		}catch(Exception ex){
			ex.printStackTrace();
		}
		 
		
	}
	public Connection getConn() {//반환값이 필요함으로
		return conn;
	}
	public static void main(String[] args){
		new MyOracle();
	}

}
